package com.azh.server.client;

import com.azh.server.transport.APackger;
import com.azh.server.transport.Package;

/**
 * @author zhaozhenhang <zhaozhenhang@kuaishou.com>
 * Created on 2022-05-02
 * 往返数据
 */
public class ATripper {

    private APackger aPackger;

    public ATripper(APackger aPackger) {
        this.aPackger = aPackger;
    }

    public Package roundTrip(Package pkg) throws Exception {
        aPackger.send(pkg);
        return aPackger.receive();
    }

    public void close() throws Exception {
        aPackger.close();
    }
}
